// @ts-nocheck
import sensor from '@system.sensor';
var heart=0;
export default {
    data: {
        title: '鸿蒙',
        Sensor: ''
    },
    onInit(){
        console.log("onInit");
    },
    onShow(){
        var time1=setInterval(this.getInfo,1000)
    },
    getInfo(){
        this.Sensor=heart;
        console.log(heart);
    }
}
sensor.subscribeHeartRate({
    success: function(ret) {
        console.log('get heartrate value:' + ret.heartRate);
        heart=ret.heartRate;
    },
    fail: function(data, code) {
        console.log('Subscription failed. Code: ' + code + '; Data: ' + data);
    },
})